﻿Imports System.IO

<Serializable()> _
Public Class Relation

    Private _ID As Guid
    Public Property ID() As Guid
        Get
            Return _ID
        End Get
        Set(ByVal value As Guid)
            _ID = value
        End Set
    End Property

    Private _ObjectTypeTemplate_ID As Guid
    Public Property ObjectTypeTemplate_ID() As Guid
        Get
            Return _ObjectTypeTemplate_ID
        End Get
        Set(ByVal value As Guid)
            _ObjectTypeTemplate_ID = value
        End Set
    End Property

    Private _RelationType As enmRelationType
    Public Property RelationType() As enmRelationType
        Get
            Return _RelationType
        End Get
        Set(ByVal value As enmRelationType)
            _RelationType = value
        End Set
    End Property

    Public Overloads Function ToString(ByVal aLevelToIdent As Integer)
        Dim myIdent As String = String.Empty
        For I As Integer = 0 To aLevelToIdent
            myIdent &= vbTab
        Next
        Dim mySW As New StringWriter
        With mySW
            .WriteLine(String.Format("{0}ID                                 {1} ({2})", myIdent, ID, ID.GetType.ToString))
            .WriteLine(String.Format("{0}ObjectTypeTemplate_ID              {1} ({2})", myIdent, ObjectTypeTemplate_ID, ObjectTypeTemplate_ID.GetType.ToString))
            .WriteLine(String.Format("{0}RelationType                       {1} ({2})", myIdent, RelationType.ToString, RelationType.GetType.ToString))
        End With
        Return mySW.ToString

    End Function
    Public Overrides Function ToString() As String
        Return ToString(0)
    End Function
End Class
